fixed a bug where it only worked in chrome