Improved buy button js