adding some feature detection to make sure runs smooth on all browsers