Fixing bug with inputs within other elements inside the td