cleaner handling of localhost special-case