add mode to validation