fix timing of render event