added changes to javascript