Made timing more robust