properly detect if we're in browser or not