added code connecting profiles