Spanking children can be damaging, study says