Temporarily fixed login (see Issue 45) but should invesigate why this works as it is a messy fix