added logging stuff