Fixed pointer bug