Added form validation since its needed by the GUI