fix a bug in Shape class