fix npe

append console text to log file