Added extra check to test if placeholder.element is a function.