check types and 1-based