removed error output from mysql
added transaction support