fix bugs printer and boundary