Modified sidebar to handle nested directories