Added connect to function