Implemented check for went outside of structure