Revert "Revert "Update for removing memory leak""