improved JS search