first version, change course
fix condition for create document