added handling of files