Fix off-screen bug