Added logout abd fixed login loop with auth