Added listener for redirects + cleanup