Fixed some pointer bug