modify some error
refactor demo file