init app add main function