detect singular matrices