adding ifNA function - check matrix elements