fix returning a ptr