modify code for auto completion