Fixed problem when dir doesnt exist