Improved behavior of negative button and added custom keyboard for history