made some changes to js