Working on validation function for modal