fixed a bug with graphics going offscreen