A study says exercising can safeguard brain health