adding conditional around file declaration in mkdir