added tests for controller
merged with head