removed unnecesary handleLocationChange() function and added .() to fix memory leak in dialog.js