Fix extract hostname