resolved issues with sorting