login looks nasty but works