Modifying the error function to skip unknown points