fixes a timing bug