Added exception handling if dir does not exists