fixing javascript error?