Fix Memory Leak.Inspite of creating new scope, it isn't used and called  method