Added a try/catch for categories