Added a method to trim whitespace before adding a task