fixed server errors by moving js calls into the view
fixed conflicts....