add ut and pretty format of stack trace