fixed a bug in square example