Updated password validation and flash messges displaying