implemented logging to file with timestamp