added ctrl z functionality for history