added sort to create dialoge