Fixes issue with lost javascript events