added proper lapack check to address issue #2291