fixed javascript bug on Firefox - issue #7