Iran treads carefully while avoiding war