fix bug

if opts is null, program throw an error