Add function updateStatus

almost finish