return obj by function