added support for periodic tasks