Add path's valid check