Added isset condition on the same to avoid undefined index error.