Fix bug on random directory creation