added mode class
fixed namespace