fixing bug with inputs