minor code tweaks debugging authenticate