Fixes bug with page overlapping