fixed function call bug --KW