fix the gap bug