Added 2 methods to form validation