Implemented the 'x' button