moved error flush to a common place in TextField