add trim for required rule