diff --git a/matlab/check_posterior_analysis_data.m b/matlab/check_posterior_analysis_data.m
index a968fdbe6a8f0b489262c8ea472fdf803e43341c..243b2d48da4a4653f7c12e04b0a6c6eb2b578d81 100644
--- a/matlab/check_posterior_analysis_data.m
+++ b/matlab/check_posterior_analysis_data.m
@@ -22,13 +22,14 @@ if nargout>1
     description = '';
 end
 
-MetropolisFolder = CheckPath('metropolis',M_.dname);
+[MetropolisFolder, info] = CheckPath('metropolis',M_.dname);
 
 % Get informations about mcmc files.
-if ~exist([ M_.dname '/metropolis'],'dir')
+if info
     disp('check_posterior_analysis_data:: Can''t find any mcmc file!')
     return
 end
+
 mhname = get_name_of_the_last_mh_file(M_);
 mhdate = get_date_of_a_file([MetropolisFolder filesep mhname]);