Fixed deletion bug for GUI