Move the close function declaration to the correct scope.
Merge branch 'hotfix/1.1.1'