Added error check to settings class