Fixed authentication issue in ApplicationController