removed some unused code and added blocking to slots.