added code for updating the status