Hack for enabling sorting by custom fields