changing code for old version