Added some error handlers