remove redundant code in is_active_trail function