Fixing tranaction error in sqlite