add test and duck typing check