Fix the problem when last path deleted