Fix for the javascript bug