js exception fix