fixed js events errors