Build and sell functions fixed