added keydown functionality