check for valid route