Error checking for bad path