Here you are calling provider as a function?  That doesn't look right to me.