Fixed issue related to sort and render functions