Fix Bugs with frame ordering