fix hostname matching. It was only backward matching.