log fixed and some cleanign