add memoization for browser check