I think there is a small typo in this instruction 

getComponentsByType does not work, but getComponentByType does.