added checks to ensure players cannot allocate more resources than they own