fix nil pointer dereference error in /login