fixed an array to pointer bug