fixed return type in pointer case