fixed sorting bug that allowed records to be displayed when not appropriate
Merge branch 'develop'