major revamp for fixing login