update to check type of 3rd argument
update test