fix errors in preferences model