adding check for files