Fix reference to ApplicationController that doesn't always exist