fixed error with frame mismatching