trying to fix diretory check