stat() can give an error, handle that