fixed preferences bug