adding custom logging level, adding some threading