fixed a bug in grep