working with sliding mode