updated model logic