fix getnewvalue logic