Moving background.onclick to where x.onclick and esc key press happen