added scope.apply for ESC key binding