moved options variable, due to scope problems.