Added state filtering