fixed bug with opts