add display error option
fixed transaction. begintransaction and commit was missing