Shouldn't this be `if (isset($options['format'])) {` ?