Update getTrace function for current db structure