buy functionality update