Defensive programming for older browsers