Fix logic error add to queue