fixed purchase bugs