Added payload to openwin function