type checking of return types