made some updates to javascript