add history + keyboard listaner