fix bug for multiple factors