Fixed improper calculation of delay