Javascript issue resolved