added error handling to new models