add stablize function