add error catching
Merge branch 'controller' into dev