Added distance check for stairs