add logic in model