add and remember javascript callback