Fixes sort object problem