Fix market logic