Okular macOS can't directly open pdf files

I’ve set okular as the default pdf reader for my Mac but when I double click a pdf file it doesn’t open the file instead it just opens okular, and I have to open the document by clicking “open document” in the okular app interface. It’s the same if I right-click the file and select “open with” then select okular. Is there a way to directly open pdf in okular by just clicking on the file? Thanks!