add event cloud logic and revise the other code related.