Flash messages and form validation added