update from mac branch
resolve conflicts