check for files first