fixed bug with connection and stuff