Fixed example with new API