fixing deprecated setvalue method