modified buy buttom behaviour