fixed return value check