Adding input handler