Solving segmentation fault

This commit solves a segmentation fault error.

Signed-off-by: José Guilherme Vanz <guilherme.sft@gmail.com>