Palladium catalysed functionalisation of heterocycles