fix the "is not object" error

You can do insert and updates without errors