Remove popup url variable on success
This commit also fixes the onLoad if statement