Fix is_new method

When insert query failed the is_new method return false instead of true.

So I propose you a fix.