Fixed auto_increment issue on duplicate update
Added error logging inside all catch blocks