more robust settings handling