update app.asp - define function