fixed bug in rendering when paginating was used