Added code for old versions