Bug fixes, added Sorting feature

sorting added, Bug fixes including the positioning of the filter popup
when the clicked position is at the right most side of the window