fixed return value checks