try to make compatible with more browsers