adds a handler for model and value attributes