fixed some bug; add queue