fix redirect to login [Closes #133]