add random feature and fix bug