fix interval checking