Fixes sorting issue