implement our own version of PrintStackTrace