detects queue from rails database