fixed seg fault with print