fix preferences bug