fixed bug in attack function