adding logging and bg bt