fix timing error in tests