Set mode on init