add reference signal function to pll; fix memory leak