added possibility to use own filename for pref storage