added header
added logging