bug fixes on id selector matching