Solves the taking too much time to display problem