manage rest times correctly in cgi