fixing buy bug