some fixes and queue functionality