bug fix with sensitivity edge detection