added support for preference

Please merge added support for preference...