add lock to get file name