fixed return value and added doc