Fix small js bug when you click sort buttons