fix bug for checking data