add travis yml and fix some code