[fix] check if the dir filepath exists