fix two problems in model