Check added to avoid objects being kicked out of the screen.