update status logic