fix the dwell time bug