check path valid