fixes overflow issue and new frame image