Fixing bug on input update