Fixed resource leak

Change-Id: Iaaf22de8e4b1a67dc0df2b8882bcfb6ab589ef80