fixed an issue preventing this from working in firefox