Dynamical analysis of the infection status in diverse communities due to COVID-19 using a modified SIR model