adding some logic to initialize to collect metrics