close modal wasn't done correctly