added X button to mimic the end button