compile and fix bug