fixing a bug preventing attacking from working