ported over changes from headend