Fix purchase functionality