fixing some issues with connections & debugging