added more tests and fixed the update method in controller