Invalid login is now handled and duplicate id when registration is also handled