fix some bugs from the basic intelligence