fix bug for purchase