Fixing IE problems

Ie doesn't fully support querySelector, so we have to rewrite a browser
built-in function