Added validation and flash for catching