Adding close button to modal as well as validation logic