add printStackTrace() function fixing #276