new authentication code and controller logic updates