#33 added null check to setValue