fixed the imput handler