checking data consistency
checking input consistency