Fixing js error in base class