remove superfluous alert() in js