added support for custom intervals