more boundary check