make sure js doesn't crash