JavaScript fixed, jasmine passing again