fixing bugs in ProcessFrame