fixed grep return value check