fixed switching sides and dying randomly