updated to use provider