bug fix for class creation
fixing javascript