Fixed memory leak

There was a memory leak because of the create function.