add web support and fix a bug