debugged with N and fixed foriegn key constraint and redirect to switch ...

...to view::make