Adding Queue logic