cleaned up hostname checking.