Preheat oven to 350 degrees F.
Cook potatoes according to package directions; set aside.
Brown beef and onion (optional) in a skillet on medium-high heat.
Drain and put back in skillet with carrots over medium-high heat.
Stir in flour, 1 teaspoon salt, and 1/4 teaspoon pepper.
Add broth. Cook, stirring constantly, for 3 minutes or until slightly thickened.
Spoon mixture into a lightly greased 11 x 7-inch glass backing dish.
In a mixing bowl, combine mashed potatoes, egg, 1 teaspoon salt (optional) and 1/4 teaspoon pepper. If using pre-cooked mashed potatoes, you may want to taste potatoes before adding the egg to see how they are seasoned. If they are already salted appropriately, you can omit the salt.
Spoon over beef mixture and smooth evenly across the dish.
Bake for 25 minutes.
Sprinkle with cheese, and bake an additional 5 minutes.
Garnish with parsley if desired.