Handling of MySQL errors added