fix bugs in update_or_create_by