fix the timing of focusing to iframe
minor fixes