udpate trim() prevent error