connect 3 times function added