fixed bug for queue