fixed issue that blak space character is ignored due to trim();