changes to improve logging