fix timing problems