use appropriate method to return trace
bugfix: typesafe comparison because data might be an index-based array