add queue functionality and make token work