tweaked some stuff on javascript