add begin and close path in shapes