better logg handling