js fixes as per review