fixed a small wait interval computation issue