wrap main function in anonymous function