fix problem with max interval