Added checks to cater for invalid preference values