update trace method

now return a string