fix showing delete dialog and add matrial_type functions