Changed daemon event to wait until file is finished writing