changing preference and adding unit test