fix the wrapping on backward searches