small changes to keep stack trace