Fixed bug in timing