return ptr instead of val