modified  loggin stuff