had to make some changes to make opts optional