fix bug + code format