Fixed a few bugs and added an option to leave the queue