added test for root directory and improve category