make example workable in docker and fix a bug