Moved reading of  options to prevent Undefined Index notice