save to db & fix bug