Fixing the use of the trim method