another fix for js crashes