check return types in functions