unable to set  properties in a function call