fixed bug and add feature about env check with newline