fix frame out of bounds