Fix bug in extension