logging changes and bug fixes