fixed the bug where the modal was coming up even if the fields were incorrect