improve check for nodejs or the browser