fix wrong calculation of active tasks