Corrected a javascript bug