Fixed sorting bug with top update