update status logic in rake task