Fixed bug where did not initiallize preferences and were calling them