changed the logic of connecting to chat and finished Profile popup