fixed crash when creating shapes