fixed multiple array pointer bug