Recalculate wait time

Fix calculation of wait time