fixing form submit bug and reorganizing process dialog code