fixed `processed` flag bug