added checking for exit accesibility