added checking of return types