Bug fix

freeing none used memory