fix buy bug