fixed directive sub generator bug