added check to prevent error in wordpress versions 3.7 and older.