fixes sold function