Corrected Javascript