added option to restrict interval