fixed the Popen and filter