fixing status calculation issue