fixing error when javascript stops working if category is not set