added error messages if fields are empty