Stability analysis of an SIR model with immunity and modified transmission function