NullPointerException in grep search