added js events, minor fixes