Improved error handling and form validation in browser