Fix undefined index error when setting DatabaseObject