added simple javascript callback handler