fix compilation errors
format code