Thanks @pjackson28, I updated the code to use trim() instead