use _type when constructing object from hash (fix bug)