wrong location

use window.location, not window.location.top