fixed print false because of improper malloc