Correctly calling login method