working modal validation