better required options check function