Safer cancel button creation in walled garden JS