working code; logger is not working properly for multiple data files