Bugfix: correct check for active record