Graph removed from the modal when closed