crazy stuff to implement stack traces