fixed tests and modified controller