wraps function in verstion check