Added Validation error dialog and moved Path logic to own function