Prevent from pushing visited cells into the stack