Form validation, bad query handling done