Added additional check on login