added set attack function