Bug fix: handle empty result sets
Refactor afterFind hook