Introduced HandleScope to cleanup memory properly