add betsy tests OnEvent internal mex def