Some modifications to js