main: fix main function