fix bug in non-browser, make some change on non-browser's example