Using non deprecated call to set object class