addede encodeing to application controller