fixed a bug in getBoundaries()