Fix for sorted