modified model so it handles null