properly convert value before set