changed the way it checks if it is running locally