trim function added