dded handlers to prevent min < max
fix #2