adding a test to avoid empty dom node
hidind of overlay loading if an error occured
bugfix : to correct encode parameters use encodeURIComponent