fix function calling