Added "active" check when logging in