fixed key error when detection not present