added validations and tweeked error message