fixed sorting in views