Added functionality to the discard target button in the tools menu