fix: should check type of opts argument.