added logging to authenticate