fix bug where enter key would cause malformed polygon on enter