fixing error in function call