fixed some connection bugs. TODO: create profile before connection opening