added error message when creating a new record in loan history