1. fix some bugs