Password validation and flash in layout