added logic to remove old log files