Fixing orphan page bug