changes to make this functional on version 4.2.x and later