Cleared up dynamic memory after done using it