logging and things fixed