hack around [Object] in the input value

also factored out the update scope as same function body was repeated twice
This affects #12