fix wait for frame
(cherry picked from commit 1efb1eccac650518ad5c8310ca465fccf350a871)