Add test and fix controller method