Fixes the disconnecting bug

Gets rid of the bug where the curve wouldnt connect to the last endpoint