Fixed segmention fault.