Fixed stupid mistake resoulting is segfault.