fix bug in refactoring (#active_or_pending should have been #active_or_pending?)