FIX: mysql error checking