Third commit. Added more error handler functions