Added some logging
Improved queue management