added handler for preferences