add setPristine when closing alert