improved the error handling by adding more clear messages for the end user