fix preference nullpointer