Make login robust