Retrieve category ID dynamically