fix move-frame function