Fix version detection by retrieving version at runtime