Fix timing bug