updated for logging