add main as func