Fixed #2, undefined variable notice for selector
Added newline before script block