fixed some errors in controller. Still working on form submission