fixed bug that caused player to lose resources