fix bug where a required field would not be created at the right level