Fixed error when updating the active record with set(). And When updating make sure the primary key is removed