added conditional around compatibility code