update add main function