fixed lost main function