fix bug in non-browser