Updated controller with better nid code
Merged fixes
Bug fixes
merge