added error validations and fancy error messages