Added option to provided a condition for whether mapping occurs