add missing files, fix bug