fixes slow loading for huge dataset