Avoid getting undefined navigator when running on the server