create component using modal, working but modal not closing after submission