...
use ref instead of ptr