added some debug helpers to help track down a bug when running in firefox