fixing bugs in ProcessFrames