Fix the bug with undefined hostname