fix setItem implementation for undefined values