added logging stuff back