Added support for legacy browsers