pointer bug fix