change the way to detect library authorization status