Fix the bug on middleman