fixing errors in controller
fixing bugs
cleaning up bad rebase