figuring out why location undefined