fix stupid closure bug
logging and formatting