have the sample comply to the new API