Adds 'trap' attribute for default prevention.