fixed the frame movement and position to deal with modal transitions.