Fixed a javascript bug