moved connection call to tick() function