Fixed delete functionality of table