Adding checkQueue method.