diff --git a/src/Distribution/Distribution.cpp b/src/Distribution/Distribution.cpp
index 3438fe6175b9dd2b868d9277aacefd4875ab8ca6..14f84016cd9c244ec58c594362ade55e0f6c5038 100644
--- a/src/Distribution/Distribution.cpp
+++ b/src/Distribution/Distribution.cpp
@@ -1005,7 +1005,7 @@ void Distribution::createDistributionFromFile(size_t /*numberOfParticles*/, doub
     // Data input file is only read by node 0.
     std::ifstream inputFile;
     std::string fileName = Attributes::getString(itsAttr[Attrib::Distribution::FNAME]);
-    if (!boost::filesystem::exists("fileName")) {
+    if (!boost::filesystem::exists(fileName)) {
         throw OpalException("Distribution::createDistributionFromFile",
                             "Open file operation failed, please check if \""
                             + fileName +