Prevent error "undefined method `application` for nil class"