Added timer and fixed threshold.