changing print to log