Logout now functions properly