updated JavaScript