added trim to chat