fix query selector bug
add js module functions
add singleton js snippet