Pass the block to the connect method