adding logic to clean up some status issues