Proper chain calling
Fixed sample to not use deprecated methods