Before connect script implemented