added some finishing touches on authentication