Add delete button and bug fixes