error fixing and some form validation