corrected logging to both screen and file