fixed several bug with shapes