log working correctly also