fixed grep hostname ... it is necessary to grep with before context to obtain correct hostname