fix bug in elaboration