adding checks for older browsers