fix printing to stdout & file create/append