removed global and used FRAME_RATE constant