fixed incorrect end setting and increased threshold of sliding action