fixing undefined error when a guid is invalid