add lock for logfile