trying to catch mysql errors