use file name to check if file exists, fixes #1032