fix main function calling