fix to prepare dir