Delete button and queries