add span and offset hooks