fix complex bug