added error messaging