move version-check into lib