version with logging