fixed auth, added logout