small fix, if $options is empty to prevent entering loop