added validations, flash message