Addition of queue logic

Addition of queue logic, so if a job of the same type already exists in the queue then another one is not added.