1. fix two bugs