bug in timing code