Moved sleep outside a if clause so that sleep_interval is always used.