adding key handler
improved key