segment fault fix ok, and better user experience to test