Define more precisely the removeDialog and delete function.