added prompt validation