fixed major logging issues