fixed grep bug