Fix/fixing javascript bug