fix many market bugs
merging