improves error reporting for files with prefix