fixing conversion from db to object bug