now the modal only appears when it should