fixed bug when a file is not available