Added write to log