Fix bug of SEGFAULT by capping the drawing of each point