whoops fixing sql error handling