fix sample codes in doc