Alert window only when validation is true