changed log function