add queue
refactor js and views