added method to update total number of attacks