add options parameter, set conditions from options